<%-- 
    Document   : nutricion
    Created on : 31/08/2014, 03:04:29 AM
    Author     : leonhart
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="net.sf.jasperreports.engine.*"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<jsp:useBean id="base" class="metodo.metodospaciente" scope="page"></jsp:useBean>
<% try {
    
if(base.conectar()) {
    //jasperreport reporte= jaspercompilemanager.compilereport("reporte\\autos");
    JasperReport report = JasperCompileManager.compileReport("/Users/Jorge/Documents/NetBeansProjects/proyecto_nutricion/web/reportes/Pacientes.jrxml");
    byte[] bytes= JasperRunManager.runReportToPdf(report, null, base.conexion);
    response.setContentType("application/pdf");
    response.setContentLength(bytes.length);
    ServletOutputStream outputStream = response.getOutputStream();
    outputStream.write(bytes, 0, bytes.length);
    outputStream.flush();
    outputStream.close();
}}
catch (Exception e) {
out.print("no es posible cargar el archivo" + e); }

 %>   
